package com.bawei.mall.user.factory;

import com.bawei.common.core.domain.R;
import com.bawei.common.core.utils.StringUtils;
import com.bawei.mall.user.domain.CusUser;
import com.bawei.mall.user.remote.RemoteUserInfo;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteUserInfoFallbackFactory implements FallbackFactory<RemoteUserInfo> {


    @Override
    public RemoteUserInfo create(Throwable cause) {

        return new RemoteUserInfo(){
            @Override
            public R<CusUser> findByName(String username) {
                return R.fail();
            }
        };
    }
}
